package net.sipvip.server;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import javax.jdo.annotations.IdentityType;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Videos {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;

	@Persistent
	private String cookies;
	@Persistent
	private String video;
	@Persistent
	private String image;
	@Persistent
	private Date create_date;
	@Persistent	
	private String description;
	

	public Videos(String create_date ){
		Date today = null;
		DateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
		try {
			today = df.parse(create_date);

		} catch (ParseException e) {
			e.printStackTrace();
		}
		this.create_date = today;
		
	}
	public Videos(String cookies,String video,String image,String create_date,String description){
		this(create_date);
		this.cookies=cookies;
		this.video=video;
		this.image=image;
		this.description=description;
		
	}
	
	public Long getId() {
		return this.id;
	}	
	
	public String getVideo() {
		return video;
	}

	public void setVideo(String video) {
		this.video = video;
	}

	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}

	public Date getCreate_date() {
		return create_date;
	}

	public void setCreate_date(Date createDate) {
		create_date = createDate;
	}

	public String getCookies() {
		return cookies;
	}

	public void setCookies(String cookies) {
		this.cookies = cookies;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
}
